package com.erli.exchange.model;


import java.time.LocalDateTime;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.erli.exchange.common.validate.LoginGroup;
import com.erli.exchange.common.validate.RegisterGroup;
import com.erli.exchange.common.validate.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * @desc TODO
 * @title UserModel.java
 * @package com.erli.exchange.model
 * @author lihu
 * @update 2019-03-17 23:01:10
 */
@ApiModel
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserModel  {

	//主键id
	@ApiModelProperty(value = "主键id")
	@NotNull(message="ID不可为空", groups= {UpdateGroup.class})
	private Integer id;
	
	//用户手机号
	@ApiModelProperty(value = "用户手机号")
	@NotEmpty(message="用户手机号不可为空", groups= {RegisterGroup.class, LoginGroup.class})
	private String mobile;
	
	//用户密码
	@ApiModelProperty(value = "用户密码")
	@NotEmpty(message="用户密码不可为空", groups= {RegisterGroup.class, LoginGroup.class})
	private String password;
	
	//用户昵称
	@ApiModelProperty(value = "用户昵称")
	private String nickName;
	
	//邮箱地址
	@ApiModelProperty(value = "邮箱地址")
	private String email;
	
	//创建时间
	@ApiModelProperty(value = "创建时间")
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime createTime;
	
}
